package com.iot.manage.result;

import lombok.Data;

@Data
public class Result {

    private static final long serialVersionUID = 791696718051921790L;

    private Object data;
    private Object meta;

    public static Result build(Object data, Code code) {
        Result result = new Result();
        result.setData(data);
        Meta meta = new Meta();
        meta.setStatus(code);
        meta.setMsg(code.getDescribe());
        result.setMeta(meta);
        return result;
    }
}
